from HIT.metasearch import metasearch

# peoplesearch function that searches for data about authors
def peoplesearch(first_name, last_name, location=None):
    if location:
        searchresults = metasearch(first_name + ' ' + last_name + ' ' + location)
    else:
        searchresults = metasearch(first_name + ' ' + last_name)
    
    r1 = []
    
    for engine in searchresults:
        for r in engine[:10]:
            r1.append(r['url'])
    
    r1 = list(set(r1))
    
    # If this function needs to be extended using some social media or the like,
    # you can add a list of url's to the dictionary that is returned
    
    return {'Google, Bing and Yahoo': r1}